package com.tl.app.service.impl;

import java.util.List;
import com.tl.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.tl.app.mapper.AppGiftMapper;
import com.tl.app.domain.AppGift;
import com.tl.app.service.IAppGiftService;

/**
 * 礼物Service业务层处理
 * 
 * @author suhp
 * @date 2024-06-21
 */
@Service
public class AppGiftServiceImpl implements IAppGiftService 
{
    @Autowired
    private AppGiftMapper appGiftMapper;

    /**
     * 查询礼物
     * 
     * @param giftId 礼物主键
     * @return 礼物
     */
    @Override
    public AppGift selectAppGiftByGiftId(Long giftId)
    {
        return appGiftMapper.selectAppGiftByGiftId(giftId);
    }

    /**
     * 查询礼物列表
     * 
     * @param appGift 礼物
     * @return 礼物
     */
    @Override
    public List<AppGift> selectAppGiftList(AppGift appGift)
    {
        return appGiftMapper.selectAppGiftList(appGift);
    }

    /**
     * 新增礼物
     * 
     * @param appGift 礼物
     * @return 结果
     */
    @Override
    public int insertAppGift(AppGift appGift)
    {
        appGift.setCreateTime(DateUtils.getNowDate());
        return appGiftMapper.insertAppGift(appGift);
    }

    /**
     * 修改礼物
     * 
     * @param appGift 礼物
     * @return 结果
     */
    @Override
    public int updateAppGift(AppGift appGift)
    {
        appGift.setUpdateTime(DateUtils.getNowDate());
        return appGiftMapper.updateAppGift(appGift);
    }

    /**
     * 批量删除礼物
     * 
     * @param giftIds 需要删除的礼物主键
     * @return 结果
     */
    @Override
    public int deleteAppGiftByGiftIds(Long[] giftIds)
    {
        return appGiftMapper.deleteAppGiftByGiftIds(giftIds);
    }

    /**
     * 删除礼物信息
     * 
     * @param giftId 礼物主键
     * @return 结果
     */
    @Override
    public int deleteAppGiftByGiftId(Long giftId)
    {
        return appGiftMapper.deleteAppGiftByGiftId(giftId);
    }
}
